<?php
namespace Admin\Model;
use Think\Model;

class EventModel extends Model {

    protected $_validate = array (
		array('title','require','Title cannot be empty', 1),
		array('date','require','Date cannot be empty', 1),
		array('starting','require','Starting Time cannot be empty', 1),
		array('ending','require','Ending Time Time cannot be empty', 1),
		array('address','require','Address cannot be empty', 1),
		array('city','require','City cannot be empty', 1),
		array('state','require','State cannot be empty', 1),
		array('zip','require','Zip code cannot be empty', 1),
		array('content','require','Panelist cannot be empty', 1),
		array('speaker','require','Speaker Bio cannot be empty', 1),
    );	

    protected $_auto = array (
		array('createTime','time',Model::MODEL_INSERT,'function'),
		array('updateTime','time',Model::MODEL_BOTH,'function'),	
		array('date','_date',Model::MODEL_BOTH,'callback'),
	);

	protected function _date(){
		return strtotime(I('post.date'));
	}

}
?>